#ifndef Factory_H
#define Factory_H

#include "Fruit.hpp"
#include "Apple.hpp"
#include "Banana.hpp"
#include "Pear.hpp"
#include <string>

class Factory
{
public: 
    virtual Fruit* create_fruit(const std::string& name) const{
        if(name == "banana"){
            return new Banana();
        }else if(name == "pear"){
            return new Pear();
        }else if(name == "apple"){
            return new Apple();
        }
        return nullptr;
    };
};

#endif

